package com.lovo.service;

import com.lovo.dao.UserDAO;
import com.lovo.model.UserDO;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;

//@Data
@NoArgsConstructor
@Service
public class UserService implements IUserService{
     @Resource
    private UserDAO userDAO;
    public UserDO findById(String userId){
        return userDAO.findById(userId);
    }

    @Override
    public void add(UserDO userDO) {
        userDAO.add(userDO);
    }

    @Override
    public void del(String id) {
        userDAO.del(id);
    }

    @Override
    public void update(String id, String pwd) {
        userDAO.update(id,pwd);
    }

    @Override
    public UserDO login(String phone, String pwd) {
        return userDAO.login(phone,pwd);
    }

}
